//@author A0096950U
#include "Task.h"

const string Task::STRING_TASK_ACTIVE = "TASK_ACTIVE";
const string Task::STRING_TASK_DONE = "TASK_DONE";
const string Task::STRING_TASK_DELETED = "TASK_DELETED";
const string Task::STRING_TASK_ONGOING = "TASK_ONGOING";
const string Task::STRING_TASK_OVERDUE = "TASK_OVERDUE";

Task::Task(void) {
}

Task::Task(string description,
		   string date,
		   string time_start,
		   string time_end,
		   string tag) {
			   this->status = TASK_ACTIVE;
			   this->description = description;
			   this->date = date;
			   this->time_start = time_start;
			   this->time_end = time_end;
			   this->tag = tag;
}

string Task::toString() {
	stringstream outString;

	outString << description << " | " << date << " | " << time_start << " | " << time_end << " | " << tag << endl;

	return outString.str();
}

string Task::taskStatusToString(TaskStatus taskStat) {
	string toReturn;

	switch (taskStat) {
	case TASK_ACTIVE:
		toReturn = STRING_TASK_ACTIVE;
		break;
	case TASK_DONE:
		toReturn =  STRING_TASK_DONE;
		break;
	case TASK_DELETED:
		toReturn =  STRING_TASK_DELETED;
		break;
	}

	return toReturn;
}

string Task::getDate() const {
	return date;
}

string Task::getStartTime() const {
	return time_start;
}

string Task::getEndTime() const {
	return time_end;
}

string Task::getDescription() const {
	return description;
}

string Task::getTag() const {
	return tag;
}

TaskStatus Task::getStatus() const {
	return status;
}

string Task::getID() const {
	return id;
}

void Task::setID(string newID) {
	id = newID;
}

void Task::setStatus(TaskStatus newStatus) {
	status = newStatus;
}